<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>订单详情</title>
    <style>
        body {
            font-family: sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
        }

        h1 {
            text-align: center;
            background-color: #4CAF50;
            color: #fff;
            padding: 1rem 0;
            margin: 0;
        }

        .container {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 2rem;
        }

        .time-selector {
            margin-bottom: 2rem;
            display: flex; /* 使用flexbox布局 */
        }

        .time-selector label {
            margin-right: 10px; /* 添加标签和单选按钮之间的间距 */
        }

        .orders {
            display: flex;
            justify-content: space-around;
            width: 100%;
        }

        .order-section {
            background-color: #fff;
            padding: 1rem;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            width: 30%;
            margin: 0 1rem;
        }

        h2 {
            color: #333;
        }

        pre {
            white-space: pre-wrap;
        }
        .back-button {
            margin-top: 20px;
            text-align: center;
        }

        .back-button a {
            display: inline-block;
            padding: 10px 20px;
            background-color: #4CAF50;
            color: white;
            text-decoration: none;
            border-radius: 5px;
        }

        /* 图片展示区域样式 */
        .image-area {
            position: fixed; 
            top: 0;
            left: 0;
            width: 100%; 
            height: 100%; 
            z-index: 100; 
            pointer-events: none; /* 添加此行 */
        }

        .image-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); /* 缩小缩略图大小 */
            grid-gap: 1rem;
            position: absolute;
            top: 0;
            left: 0;
            pointer-events: none; /* 添加此行 */
        }

        .image-wrapper {
            position: relative;
            text-align: center;
            overflow: hidden;
            pointer-events: auto; /* 添加此行 */
        }

        .thumbnail {
            width: 100%;
            height: auto;
            transition: transform 0.3s ease;
        }

        .image-wrapper:hover .thumbnail {
            transform: scale(1.1);
        }

        .overlay {
            position: fixed; 
            top: 0;
            right: 0;
            width: 50%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            display: flex;
            justify-content: center;
            align-items: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
        }

        .image-wrapper:hover + .overlay {
            opacity: 1;
            pointer-events: auto;
        }

        .overlay img {
            max-width: 100%;
            max-height: 100%;
        }

        .image-wrapper p {
            font-size: 16px; /* 缩小文件名大小 */
        }
    </style>
</head>
<body>
    <h1>订单详情</h1>
    <div class="container">
        <div class="time-selector">
            <label for="time_slot">选择时段:</label>
            {% for time in time_slots %}
                <input type="radio" name="time_slot" id="{{ time }}" value="{{ time }}" {% if time == selected_time_slot %}checked{% endif %} onchange="location.href='?folder_name={{ folder_name }}&time_slot='+this.value;">
                <label for="{{ time }}">{{ time[:2] }}:{{ time[2:] }}</label>
            {% endfor %}
        </div>
        
        {% if selected_time_slot %}
            <div class="orders">
                <div class="order-section">
                    <h2>商家端</h2>
                    <pre>{{ orders['shop'].get(selected_time_slot, '') }}</pre>
                </div>
                <div class="order-section">
                    <h2>管理端</h2>
                    <pre>{{ orders['admin'].get(selected_time_slot, '') }}</pre>
                </div>
                <div class="order-section">
                    <h2>骑手端</h2>
                    <pre>{{ orders['rider'].get(selected_time_slot, '') }}</pre>
                </div>
            </div>
        {% endif %}
        <div class="back-button">
            <a href="/">返回主页</a>
        </div>
    </div> 

    <!-- 图片展示区域 -->
    <div class="image-area">
        <div class="image-container">
            {% for image in image_files %}
                <div class="image-wrapper">
                    <img src="{{ url_for('static', filename='images/' + image) }}" alt="{{ image }}" class="thumbnail">
                    <p>{{ image.rsplit('.', 1)[0] }}</p>
                </div>
                <div class="overlay">
                    <img src="{{ url_for('static', filename='images/' + image) }}" alt="{{ image }}">
                </div>
            {% endfor %}
        </div>
    </div>
</body>
</html>